package TraLaLa.Servidor.DAO;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;


public class DatabaseConnection {
	private String driver="com.mysql.jdbc.Driver";
	 
	private Connection conexion;
	public DatabaseConnection()
	{
		//como crear la conexion con mysql:
		try {
			Class.forName(driver);
			conexion = DriverManager.getConnection("jdbc:mysql://localhost/tralala", "root","");
			Statement stat= null;
			stat= conexion.createStatement();
			String sentencia= "Select * FROM cancion;";
			stat.executeQuery(sentencia);
			System.out.println("CORRECTO");
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
}
